import {createRouter as _createRouter, createWebHistory} from 'vue-router';
// 导入 凡是想要通过路由跳转的，都需要在这：1.导入  2.注册 设置对应vue组件的路径名
import Index from '../views/Index.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import Raffle from '../views/Raffle.vue'
import User from '../views/User.vue'

const routes = [
    // 注册 设置对应vue组件的路径名
    { path: '/index', component: Index },
    { path: '/register', component: Register },
    { path: '/raffle', component: Raffle },
    { path: '/user', component: User },
    { path: '/', component: Login }
]

export function createRouter() {
    return _createRouter({
        history: createWebHistory(),
        routes
    })
}
